const files = require.context('../modules', true, /\.js$/)

export default files.keys().reduce((modules, fileName)=>{
  let key = fileName.replace(/(^\.\/)|(\.js$)/ig, '')
  modules[key] =
    {
      namespaced: true,
      ...files(fileName).default
    }
  return modules
}, {})
